package main

type Mapx[Key comparable, Value any] interface {
	GetKey(Key) (Value, bool)
	Set(Key, Value)
	Delete(Key)
	Len() int
	Range(fn func(Key, Value))
	Keys() []Key
}

func New[Key comparable, Value any](threadSafe bool) Mapx[Key, Value] {
	if threadSafe {
		return newSafeMapx[Key, Value]()
	}
	return newUnsafeMapx[Key, Value]()
}
